

import 'package:flutter/cupertino.dart';
import 'package:flutter_pleasure_video/config/application.dart';
import 'package:flutter_pleasure_video/constant/color.dart';
import 'package:flutter_pleasure_video/route/router.dart';
import 'package:flutter_pleasure_video/widget/common/buttom_common.dart';
import 'package:get/get.dart';
import 'package:flutter_pleasure_video/util/extensions/widget_extensions.dart';
import 'package:flutter_pleasure_video/util/extensions/string_extensions.dart';

class PersonalPage extends StatefulWidget {
  @override
  _PersonalPageState createState() => _PersonalPageState();
}

class _PersonalPageState extends State<PersonalPage> {
  @override
  Widget build(BuildContext context) {
    return Container(
      color: AppColor.mainBlue,
      child: Center(
        child: _getBtnListUi(),
      ),
    );
  }

  Widget _getBtnListUi(){
    return Column(
      children: [
        ButtonCommonSwitch("debug_Dialog",onTap: _onClickListener, isOpen: Application.isDebugModeDialog, isShowSwitch: true),
        ButtonCommonSwitch("debug_toast",onTap: _onClickListener, isOpen: Application.isDebugModeToast, isShowSwitch: true),
        ButtonCommonSwitch("debug_log",onTap: _onClickListener, isOpen: Application.isDebugModeLog, isShowSwitch: true),
        ButtonCommonSwitch("测试",onTap:_onClickListener),
        ButtonCommonSwitch("资源",onTap:_onClickListener),
      ],
    );
  }

  //点击事件
  void _onClickListener(String title,[bool isOpen=false]) async {
    switch (title) {
      case "debug_Dialog":
        Application.isDebugModeDialog=isOpen;
        break;
      case "debug_toast":
        Application.isDebugModeToast=isOpen;
        break;
      case "debug_log":
        Application.isDebugModeLog=isOpen;
        break;
      case "资源":
        AppRouter.toBackstageHome();
        break;
      case "测试":
        "测试".toastD;
        // AppRouter.toFeedWebViewPage();
        // ("showDebugAlertTextDialog"*100).print;
        // ("showDebugAlertTextDialog"*100).dialog;

        //测试debug面板
        // DebugUtil.dialog("showDebugAlertTextDialog"*100);
        // List<YckRuleModel> modelList=[];
        // AppDialog.showImportSourceDialog(context, modelList);
        // Get.snackbar("title", "message");
      // print("123".isNum);
        break;
    }
  }

}
